<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="">
	<meta name="name" content="content">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>约麦-用声交换故事</title>

	<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
	<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">  
	<link rel="stylesheet" href="./Public/awesome/font-awesome.min.css">
	<link rel="stylesheet" href="./Public/css/play_reset.css">
	<link rel="stylesheet" href="./Public/css/play_index.css">

	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script>
            var toke = "{:S('token')->access_token}";
            var openid  = "{$Think.get.openid}";
	    wx.config({
	        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
	        appId: 'wx8ad1b47530e4c6a1', // 必填，公众号的唯一标识
	        timestamp: '{$Think.session.timestamp}', // 必填，生成签名的时间戳
	        nonceStr: '{$Think.session.nonceStr}', // 必填，生成签名的随机串
	        signature: '{$signature}',// 必填，签名，见附录1
                jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'hideMenuItems'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
            });

            wx.ready(function () {
                wx.onMenuShareTimeline({
                    title: "{$data[theme][content]}", // 分享标题
                    link: "http://ym.yuemai168.com/?m=Play&c=Index&a=themeMsg&msgid={$data[id]}&themeid={$data[theme][id]}&createtime={$data[create_time]}", // 分享链接,将当前登录用户转为puid,以便于发展下线
                    desc: '你想知道吗？',
                    imgUrl: "{$data[info][headimgurl]}", // 分享图标
                    success: function () {
                        // 用户确认分享后执行的回调函数
                    },
                    cancel: function () {
                        // 用户取消分享后执行的回调函数
                    },
                    trigger: function (res) {
//                            alert("分享到朋友圈按钮点击");        
                    },
                    fail: function (res) {
//                            alert(JSON.stringify(res));
                    }
                });

                wx.onMenuShareAppMessage({
                    title: "{$data[theme][content]}", // 分享标题
                    desc: '你想知道吗？', // 分享描述
                    link: "http://ym.yuemai168.com/?m=Play&c=Index&a=themeMsg&msgid={$data[id]}&themeid={$data[theme][id]}&createtime={$data[create_time]}", // 分享链接
                    imgUrl: "{$data[info][headimgurl]}", // 分享图标
                    type: 'link', // 分享类型,music、video或link，不填默认为link
                    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                    success: function () {
                        // 用户确认分享后执行的回调函数
                    },
                    cancel: function () {
                        // 用户取消分享后执行的回调函数
                    }
                });
//                wx.hideMenuItems({
//                    menuList: ["menuItem:copyUrl", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:email"] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
//                });                
            });
	</script>
</head>
<body>
    <div class="yuemai">
        <div class="yuemai-logo">
            <img src="./Public/img/icon@2x.png" alt="">
            <p>约麦—用声交换故事</p>
        </div>
        <a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIxNzQ1MzIyOQ==&scene=124#wechat_redirect">关注</a>
    </div>

	<div id="wrapper">

        <div class="mine-voice item">
            <div class="voice-title">
                <div class="pub1Head">
                <img class="img-circle" src="{$data[info][headimgurl]}" alt=""></div>
                <!--  <p class="pub1name">{$data[info][name]}</p> -->
                <!-- <div class="unlock-time item">
                    <div class="time">
                        <p>离解锁还剩</p>
                        <p><span id="t_d">00</span>天</p>
                        <p><span id="t_h">00</span>小时</p>
                        <p><span id="t_m">00</span>分钟</p>
                        <p><span id="t_s">00</span>秒</p>
                    </div>
                </div>    -->             
            </div>
            <div class="voice-content" onclick="Shareplay();">
                <p><span>“</span>{$data[theme][content]}<span>”</span></p>
                <a href="javascript:;"></a>
                <audio id="player">
                    <source src="http://resource.kmic168.com/v--gZrC0HC6-m5-xPjLgIK5DU30=/Fn_xe4JH9ad0-Qp_YvHI4M0V1dkC" type="audio/mp3">
                </audio>  
            </div>
        </div>

        <div class="tips item">
			<p>朋友想听你的语音，须回复特定的解锁语音</p>
		</div>
	</div>

	<div class="footer-btn">
            <a class="share" onclick="wx_share()" href="javascript:;">分享</a>
	</div>
    
    <div class="baio">
        <img class="img-responsive" src="./Public/img/fenx.png">
    </div>
    <div class="bg" onclick="bgcolse()"></div>
        
        

            <script src="./Public/js/jquery.min.js"></script>
            <script>
                var nexData = '<?php echo date('Y/m/d',strtotime("$date[create_time] +1 day"))." 22:00:00" ?>'
                // function GetRTime(){
                //     var EndTime= new Date(nexData);
                //     var NowTime = new Date();
                //     var t =EndTime.getTime() - NowTime.getTime();
                //     var d=0;
                //     var h=0;
                //     var m=0;
                //     var s=0;
                //     if(t>=0){
                //       d=Math.floor(t/1000/60/60/24);
                //       h=Math.floor(t/1000/60/60%24);
                //       m=Math.floor(t/1000/60%60);
                //       s=Math.floor(t/1000%60);
                //     }


                //     document.getElementById("t_d").innerHTML = d;
                //     document.getElementById("t_h").innerHTML = h;
                //     document.getElementById("t_m").innerHTML = m;
                //     document.getElementById("t_s").innerHTML = s;
                // }
                // setInterval(GetRTime,0);
                function Shareplay() {
                    audio = document.getElementById("player");
                    if (audio.paused){
                        clickF = audio;
                        $('.voice-content a').addClass('selected');
                        audio.play();                          
                    } else if (audio.play) {
                        $('.voice-content a').removeClass('selected');
                        audio.pause();
                    }

                    audio.addEventListener('ended', function () {  
                       $(this).siblings('a').removeClass('selected');
                       audio.load();
                   }, false); 
                }

                
                    

                function wx_share() {
                    $(".baio").css('display', 'block');
                    $(".bg").css('display', 'block');
                };
                
                function bgcolse() {
                    $(".baio").css('display', 'none');
                    $(".bg").css('display', 'none');
                };               
            </script>
</body>
</html>